<?php
class Localization extends ORDataObject {
	var	$localization_id	=	'';
	var	$vi_VN				=	'';
	var	$en_US				=	'';
	
	var	$_table				=	'localization';
	var	$_key				=	'localization_id';
	
	function __construct($db = null) {
		parent::ORDataObject($db);
	}
	
	
	
	function populate(){
		parent::populate('localization_id');
	}
	
	public function update($text) {
	    $field    =   L10nHelper::getLocale();
	    $data = array($field=>$text);
	    $this->populateArray($data);
	    $this->persist();	    
	    return $this->get_id();	    	   	    
	}

    public function addNew($text) {        
        $locales = L10nHelper::getSupportedLocales();
        $datalo = array();
        foreach ( $locales as $lo => $la ) {
                $datalo[$lo] = $text;
        }
        $this->populateArray($datalo);
        $this->persist();
        return $this->get_id();                         
    }
}
?>